package com.example.treasureadmin.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.treasureadmin.enumerate.CommentType;
import com.example.treasureadmin.mapper.TrashDataMapper;
import com.example.treasureadmin.model.TrashDataModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrashDataService {

    @Autowired
    private TrashDataMapper trashDataMapper;

    public List<TrashDataModel> getAll(){
        QueryWrapper<TrashDataModel> queryWrapper = new QueryWrapper<>();
        return trashDataMapper.selectList(queryWrapper);
    }

    public List<TrashDataModel> getDataByStatus(CommentType status){
        QueryWrapper<TrashDataModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("accept",status);
        return trashDataMapper.selectList(queryWrapper);
    }
}
